package cn.wolfcode.qo;

import cn.wolfcode.enums.ConsumptionReportEnum;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Data
public class ConsumptionReportQueryObject extends QueryObject {
    private Long businessId;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date startDate;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endDate;
    private Integer typeId;
    private String groupByName = ConsumptionReportEnum.BUSINESS.name();

    public String getGroupBy(){
        return ConsumptionReportEnum.valueOf(this.groupByName).getSql();
    }
}
